package unit3.test;

import java.util.Scanner;

public class GongYueNum {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        // 最大公约数：辗转相除法
        // 最小公倍数：x * y / 最大公约数
        int max = Math.max(a, b);
        int min = Math.min(a, b);
        while (min != 0) {
            int tmp = max % min;
            max = min;
            min = tmp;
        }
        System.out.println(max + " " + (a * b / max));
    }
}
